[XEN][XEND][POWERPC] Don't ignore shadow memory requirement
authorJimi Xenidis <jimix@watson.ibm.com>
Thu, 25 Jan 2007 20:55:25 +0000 (15:55 -0500)
committerJimi Xenidis <jimix@watson.ibm.com>
Thu, 25 Jan 2007 20:55:25 +0000 (15:55 -0500)
We don't need a custom buildDomain() anymore but we do need to provide a
shadow memory calculation.

 - Create PPC_LinuxImageHandler class to implement
   getRequiredShadowMemory().
 - Derive prose builder from PPC_LinuxImageHandlerClass.
 - Drop configure() as it is not needed according to Jimi.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
--HG--
extra : transplant_source : %09%80%DF%BA%E7F%80%5CQpNb%A1%BCF%03%CD%81PA

tools/python/xen/xend/image.py

index 1bfe6c7de21d89b51f6fa29e92de7e017b1ce58b..1d916f917a6538b2ea3c2578d523b69892321f07 100644 (file)
@@ -214,15 +214,23 @@ class LinuxImageHandler(ImageHandler):
                               ramdisk        = self.ramdisk,
                               features       = self.vm.getFeatures())
 
+class PPC_LinuxImageHandler(LinuxImageHandler):
 
+    ostype = "linux"
+    
+    def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
+        """@param shadow_mem_kb The configured shadow memory, in KiB.
+        @param maxmem_kb The configured maxmem, in KiB.
+        @return The corresponding required amount of shadow memory, also in
+        KiB.
+        PowerPC currently uses "shadow memory" to refer to the hash table."""
+        return max(maxmem_kb / 64, shadow_mem_kb)
 
-class PPC_ProseImageHandler(LinuxImageHandler):
 
-    ostype = "prose"
 
-    def configure(self, vmConfig, imageConfig, deviceConfig):
-        LinuxImageHandler.configure(self, vmConfig, imageConfig, deviceConfig)
-        self.imageConfig = imageConfig
+class PPC_ProseImageHandler(PPC_LinuxImageHandler):
+
+    ostype = "prose"
 
     def buildDomain(self):
         store_evtchn = self.vm.getStorePort()
@@ -249,15 +257,6 @@ class PPC_ProseImageHandler(LinuxImageHandler):
                                    ramdisk        = self.ramdisk,
                                    features       = self.vm.getFeatures())
 
-    def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
-        """@param shadow_mem_kb The configured shadow memory, in KiB.
-        @param maxmem_kb The configured maxmem, in KiB.
-        @return The corresponding required amount of shadow memory, also in
-        KiB.
-        PowerPC currently uses "shadow memory" to refer to the hash table."""
-        return max(maxmem_kb / 64, shadow_mem_kb)
-
-
 class HVMImageHandler(ImageHandler):
 
     ostype = "hvm"
@@ -588,7 +587,7 @@ class X86_Linux_ImageHandler(LinuxImageHandler):
 
 _handlers = {
     "powerpc": {
-        "linux": LinuxImageHandler,
+        "linux": PPC_LinuxImageHandler,
         "prose": PPC_ProseImageHandler,
     },
     "ia64": {